package com.p7.notepad.adapter;

import android.widget.ImageView;

import com.p7.notepad.R;
import com.p7.notepad.app.MyApplication;
import com.p7.notepad.bean.User;
import com.tools.s7.recycler.BaseRecyclerViewAdapter;
import com.tools.s7.recycler.holder.BaseViewHolder;

public class SwitchUserAdapter extends BaseRecyclerViewAdapter<User> {

    @Override
    protected int getLayoutId() {
        return R.layout.switch_user_item;
    }

    @Override
    protected void bindData(BaseViewHolder holder, int i, User data) {
        MyApplication.getInstance().setImage(data.getAvatar(), (ImageView) holder.getView(R.id.switch_user_image));
        holder.setText(R.id.switch_user_name, data.getNickName());
    }
}
